import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sgy_flutter/gen/assets.gen.dart';
import 'package:sgy_flutter/page/dfu/logic.dart';

class SuccessView extends GetView<DfuLogic> {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Assets.image.iconSuccess.image(width: 90),
        Text(
          "升级成功".tr,
          style: TextStyle(fontSize: 20, color: Color(0xff1E1E1E)),
        ).marginOnly(top: 30),
        Obx(() => Text(
              "${'当前版本'.tr} ${controller.targetFirmwareVersionRight.value?.isNotEmpty == true ? 'L:' : ""}${controller.targetFirmwareVersion} ${controller.targetFirmwareVersionRight.value?.isNotEmpty == true ? 'R:${controller.targetFirmwareVersionRight}' : ""}"
                  .tr,
              style: TextStyle(fontSize: 15, color: Color(0xff7a7a7a)),
            )).marginOnly(top: 14),
        Spacer(),
        Container(
          width: double.infinity,
          margin: EdgeInsets.only(bottom: 10),
          child:
              FilledButton(onPressed: () => Get.back(), child: Text("确定".tr)),
        ),
      ],
    );
  }
}
